//
// Created by nicemoe on 2021/8/9.
//

#include  <bits/stdc++.h>

using namespace std;
//0不用
int star[] = {0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 12};
int num = 0;

void Swap(int &, int &);

int Perm(int, int);

int main() {
    Perm(1, 10);
    cout << num << endl;
    return 0;
}

int Perm(int begin, int end) {
    int i;
    if (begin == end) num++;
    else {
        for (i = begin; i <= end; i++) {
            Swap(star[begin], star[i]);
            Perm(begin + i, end);
            Swap(star[begin], star[i]);
        }
    }

}

void Swap(int &a, int &b) {
    int tmp = a;
    a = b;
    b = tmp;
}